package rsync_frame_anim

import (
	"fmt"
	"gitee.com/zhongguo168a/gocodes/myx/logx"
	"github.com/codeskyblue/go-sh"
	"github.com/spf13/cobra"
	"wails/cmds/maketools"
)

func init() {
	startCmd := &cobra.Command{
		Use:   "rsync-frame-anim",
		Short: "同步帧动画",
		Run: func(cmd *cobra.Command, args []string) {
			rsync()
		},
	}

	maketools.RootCmd.AddCommand(startCmd)
}

func rsync() {
	cmd := sh.NewSession()
	cmd.ShowCMD = true
	//clientPath + "/assets/resources/project/debug_config.json"
	var err error
	{
		err = cmd.Command("/bin/sh", "-c",
			fmt.Sprintf(`rsync -avr %v %v`,
				"/mnt/d/assets/effects/帧动画/_export/",
				"/mnt/d/mycodes/yxeditor/client-game-cocos/assets/assets/bundles/extends/帧动画",
			)).Run()
		if err != nil {
			logx.Error(err)
		}
	}
}
